The KeyExists method returns a BOOLEAN that indicates whether the registry contains the specified key. You can use this method to verify that a key exists before calling a method that uses the key, such as the Get method.
KeyExists(FullKeyName)
This can be a key on either a local or a remote machine. Keys on a remote machine are specified by prefixing the key name with the machine name. For example:
\\RemoteMachine\HKLM\Software\MyProg
A BOOLEAN that indicates whether the specified key exists in the registry. A return value of TRUE indicates that the key is present in the registry. FALSE indicates that the key was not found.
HKLM\Software\MyCompany
key exists before calling the GetExpand method to retrieve the named value MyPath
from that key. <% Set Reg = Server.CreateObject("IISSample.Registry") MyKey = "HKLM\Software\MyCompany" MyPath = "HKLM\Software\MyCompany\MyPath" If KeyExists(MyKey) Then PathExpand = Reg.GetExpand(MyPath) Else Session("Error") = "Key not found in the registry" Response.Redirect("http://www.mycompany.com/ErrorHandler.asp") End If %>